
import re
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*

testCase="DBshop040_客户管理搜索客户余额充值记录"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"客户管理","客户余额","充值记录")

#1.点击被充值人输入“cyy”，点击“搜索”按钮。
#在被充值人输入框中输入用户名
firefox.find_element_by_name("user_name").send_keys(userName)
#点击搜索按钮
firefox.find_element_by_xpath("//button[@type='submit']").click()
#断言
try:
    if firefox.find_element_by_xpath("//td[text()='%s']"%userName).is_displayed():#如果用户名显示
        writeLog("%s 测试通过" % testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()